package com.hmkj.admin.controller.wx;

import com.hmkj.admin.controller.BaseController;
import com.hmkj.common.baseMapper.GenericPo;
import com.hmkj.core.po.wx.WxAccount;
import com.hmkj.core.service.wx.WxAccountService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import java.util.List;

/**
 * 平台后台微信公众号管理
 * Created by SteveLi on 2016/7/8.
 */
@Controller
@RequestMapping(BaseController.BASE_URI)
public class WxAccountController extends BaseController {
    @Resource
    WxAccountService wxAccountService;

    /**
     * 微信公众号列表
     *
     * @param model
     * @return
     */
    @RequestMapping(value = "wxaccount/list", method = RequestMethod.GET)
    public String list(ModelMap model) {
        List<WxAccount> weixinAccounts = wxAccountService.select(new WxAccount(t->t.setDelFlag(GenericPo.DELFLAG.NORMAL.code)));
        model.put("weixinAccounts", weixinAccounts);
        return getAdminTemplate("wx/accountlist");
    }
}
